#include <fcntl.h>            
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int fd = open("./log.txt", O_WRONLY | O_CREAT, 0644);

  dup2(fd, 1);
  //printf("%d\n",fd);
  char* str = "hello hql!";
  printf("%s\n", str);
  printf("%s\n", str);
  printf("%s\n", str);

  return 0;
}

